﻿using HMS.Contracts.Models;
using HMS.TenantServer.Entities;

namespace HMS.TenantServer.Extensions;

internal static class EntityExtensions
{
    internal static TenantModel ToModel(this Tenant tenant)
    {
        return new TenantModel
        {
            TenantId = tenant.TenantId,
            Name = tenant.Name,
            Schema = tenant.Schema,
            License = tenant.License,
            LicenseKey = tenant.LicenseKey
        };
    }

    internal static UserModel ToModel(this User user)
    {
        return new UserModel
        {
            TenantId = user.Tenant.TenantId,
            Name = user.Name,
            Account = user.Account,
            Alias = user.Alias,
            Password = user.Password
        };
    }
}